package lab03.test03;

import java.io.*;

public class Test03 {
    public static void main(String[] args) {
        try {
            FileOutputStream fout= new FileOutputStream("F:\\新建文本文档1.txt");
            DataOutputStream dout=new DataOutputStream(fout);
            dout.writeChars("beijing欢迎你!");
            dout.close();
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
        try {
            FileInputStream fin =new FileInputStream("F:\\新建文本文档1.txt");
            DataInputStream din =new DataInputStream(fin);
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            System.out.print(din.readChar());
            din.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
